<template>
  <div>
    <VueSeamless
        v-if="dataList.length"
        :data="dataList"
        :class-option="option"
        class="seamless-warp"
    >
      <div  @click.stop="cellClick(item)" :id="index" v-for="(item,index) in dataList" :key="index" style="display: flex" class="text-wrapper" >
        <img src="@/assets/日报.png" alt="" style="width: 16px;height: 16px;margin-right: 6px;flex-shrink: 0">
        <div class="text">
          <span>{{ item.date }}</span>
          <div v-for="text in item.day_summary || []" :key="text.title" style="margin-top: 6px">
            <i class="solid"></i>
            {{ text.title}}： {{ text.content}}
          </div>
        </div>
      </div>
    </VueSeamless>
  </div>
</template>
<script>
import VueSeamless from "vue-seamless-scroll";
export default {
  props: {
    dataList: Array,
  },
  components: {
    VueSeamless,
  },
  data() {
    return {
    };
  },
  computed: {
    option() {
      return {
        step: 0.25, // 数值越大速度滚动越快
        limitMoveNum: this.dataList.length, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000, // 单步运动停止的时间(默认值1000ms)
        click() {
          console.log('----')
        }
      }
    }
  },
  methods: {
    cellClick(item) {
      console.log('item',item)
      this.$emit("cell-click", item);
    }
  }
};
</script>

<style lang="less">
.seamless-warp {
  height: 120px;
  overflow: hidden;
  background-color: rgba(0, 147, 167, 0.4);
  padding: 12px;
  border-radius: 2px;
  .solid {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #00eff2;
    border-radius: 50%;
    margin-right: 6px;
    margin-bottom: 1px;
  }
  .text-wrapper {
    margin: 6px 0;
    cursor: pointer;
    &:hover {
      .text {
        color: #00eff2;
      }
    }
    img {
      margin-right: 12px;
    }
  }
  .text {
    font-size: 12px;
    font-family: Source Han Sans CN-Regular, Source Han Sans CN;
    font-weight: 400;
    color: rgba(255,255,255,0.8);
    line-height: 16px;
  }
}
</style>
